#include <bits/stdc++.h>
using namespace std;

int n;
int r[100005];
bool vis[100005];

int main()
{
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    memset(vis, true, sizeof vis);
    cin >> n;
    int r1 = 0, r2 = 0;
    for (int i = 1; i <= n; i++)
    {
        cin >> r[i];
        if (r[i] == 1) r1++;
        if (r[i] == 2) r2++;
    }
    cout << r2 << endl;
    return 0;
}
